-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addition of Amazon ECS job, copied code from luigi.contrib.ecs.py and… #13
base: master
Are you sure you want to change the base?
Conversation
… modified for ndscheduler JobBase.
… modified for ndscheduler JobBase.
… modified for ndscheduler JobBase. Fixed the 100 character limit
… modified for ndscheduler JobBase. Fixed the 100 character limit blank whitespace
@@ -0,0 +1,122 @@ | |||
"""A sample job that prints string.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do people pass AWS credential? Better add some operational guidelines here, e.g., create dot file on worker nodes for aws credential .
simple_scheduler/jobs/ecs_job.py
Outdated
import boto3 | ||
|
||
client = boto3.client('ecs') | ||
except ImportError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, don't catch error here. Let the error bubble up. If boto is not imported, let it fail hard.
simple_scheduler/jobs/ecs_job.py
Outdated
|
||
# Error checking | ||
if response['failures']: | ||
raise Exception('There were some failures:\n{0}'.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't raise a generic exception. Make a custom exception that subclasses Exception, e.g., ECSJobException.
Thanks, I'll update. I agree about the Exceptions and boto3 try/catch. Like I said before in the original comment this was copied from luigi.contrib.ecs, so there is definitely some mods that are needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this job. I can see that this job would be useful for Ops !
Before commit your code, better running make flake8
to for python code styling.
Yeah I'm using PyCharm so some of that is built-in, it's length limit is set to 160 characters. It looks like there are some other issues with 2 other files that I didn't edit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Change the file comment for simple_scheduler/jobs/ecs_job.py and fix the "make flake8" error, then I'll approve it :)
No sure why there are "make flake8" errors from other files you didn't touch. But they are pretty easy to fix (e.g., adding one new blank line).
@rhaarm could you pull and merge from latest master? That should fix all the flake8 error & fixed unit tests for python 3.5. Then this pull request should be good to go |
… modified for ndscheduler JobBase.